package org.uoss.core.exception;

public class UOSSException extends Exception{
	protected final static long serialVersionUID = 0l;
	private Integer errorCode;
	private String errorMessage;
	private Throwable coreError;
	public UOSSException(){
		super();
	}
	
	public UOSSException(String message){
		super(message);
		this.errorMessage = message;
	}
	
	public UOSSException(String message,Throwable exception){
		super(message,exception);
		this.errorMessage = message;
		this.coreError = exception;
	}
	
	public UOSSException(Integer code,String message,Throwable exception){
		super(message,exception);
		this.errorCode = code;
		this.errorMessage = message;
		this.coreError = exception;
	}
	
	public Integer getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(Integer errorCode) {
		this.errorCode = errorCode;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String message) {
		this.errorMessage = message;
	}
	
	public void printTraceStack(){
		System.out.println(this.errorCode + this.coreError.getMessage());
	}
	
	public String toString(){
		return this.errorMessage;
	}	
}
